@dataknut)Please note that authorship is alphabetical. Contributions are listed below - see github for details and who to blame for what :-).
@dataknut)If you wish to refer to any of the material from this report please cite as:
Report circulation:
Report purpose:
This work is (c) 2019 the University of Southampton.
# done in makefile
Data downloaded from http://southampton.my-air.uk. See also https://www.southampton.gov.uk/environmental-issues/pollution/air-quality/.
Southampton City Council collects various forms of air quality data at the sites shown in 2.1. WHO publishes information on the health consequences and “acceptable” exposure levels for each of these.
lDT <- data.table::melt(dt, id.vars = c("site", "obsDateTime"), measure.vars = c("co", "nox", "nox2", "noxes", "oz", "pm10",
"pm2_5", "so2"), value.name = "value" # varies
)
# remove NA
lDT <- lDT[!is.na(value)]
t <- lDT[, .(from = min(obsDateTime), to = max(obsDateTime), nObs = .N), keyby = .(site, variable)]
kableExtra::kable(t, caption = "Dates data available by site and measure", digits = 2) %>% kable_styling()
| site | variable | from | to | nObs |
|---|---|---|---|---|
| Southampton - A33 Roadside AURN | nox | 2016-01-26 11:00:00 | 2019-12-04 22:00:00 | 33046 |
| Southampton - A33 Roadside AURN | nox2 | 2016-01-26 11:00:00 | 2019-12-04 22:00:00 | 33034 |
| Southampton - A33 Roadside AURN | pm10 | 2016-01-04 13:00:00 | 2019-12-04 21:00:00 | 31985 |
| Southampton - Onslow Road | nox | 2016-01-01 00:00:00 | 2019-12-20 18:00:00 | 33509 |
| Southampton - Onslow Road | nox2 | 2016-01-01 00:00:00 | 2019-12-20 18:00:00 | 33505 |
| Southampton - Onslow Road | noxes | 2016-01-01 00:00:00 | 2019-12-20 18:00:00 | 33509 |
| Southampton - Victoria Road | nox | 2016-01-01 00:00:00 | 2019-12-20 18:00:00 | 25224 |
| Southampton - Victoria Road | nox2 | 2016-01-01 00:00:00 | 2019-12-20 18:00:00 | 25224 |
| Southampton - Victoria Road | noxes | 2016-01-01 00:00:00 | 2019-12-20 18:00:00 | 25224 |
| Southampton Background AURN | nox | 2016-01-01 00:00:00 | 2019-12-04 22:00:00 | 27948 |
| Southampton Background AURN | nox2 | 2016-01-01 00:00:00 | 2019-12-04 22:00:00 | 27961 |
| Southampton Background AURN | noxes | 2016-01-01 00:00:00 | 2019-01-01 00:00:00 | 20026 |
| Southampton Background AURN | oz | 2016-01-01 00:00:00 | 2019-12-04 22:00:00 | 27847 |
| Southampton Background AURN | pm10 | 2016-01-01 00:00:00 | 2019-12-04 22:00:00 | 24397 |
| Southampton Background AURN | pm2_5 | 2016-01-01 00:00:00 | 2019-12-04 22:00:00 | 26605 |
| Southampton Background AURN | so2 | 2016-01-01 00:00:00 | 2019-12-04 22:00:00 | 27399 |
Summarise previously downloaded and processed data… Note that this may not be completely up to date.
skimr::skim(dt)
| Name | dt |
| Number of rows | 209832 |
| Number of columns | 10 |
| _______________________ | |
| Column type frequency: | |
| character | 1 |
| logical | 1 |
| numeric | 7 |
| POSIXct | 1 |
| ________________________ | |
| Group variables | None |
Variable type: character
| skim_variable | n_missing | complete_rate | min | max | empty | n_unique | whitespace |
|---|---|---|---|---|---|---|---|
| site | 0 | 1 | 22 | 31 | 0 | 6 | 0 |
Variable type: logical
| skim_variable | n_missing | complete_rate | mean | count |
|---|---|---|---|---|
| co | 209832 | 0 | NaN | : |
Variable type: numeric
| skim_variable | n_missing | complete_rate | mean | sd | p0 | p25 | p50 | p75 | p100 | hist |
|---|---|---|---|---|---|---|---|---|---|---|
| nox | 90105 | 0.57 | 26.61 | 40.23 | -5.0 | 4.7 | 13.4 | 32.1 | 746.3 | ▇▁▁▁▁ |
| nox2 | 90108 | 0.57 | 37.00 | 22.54 | -1.3 | 20.5 | 33.0 | 48.8 | 287.5 | ▇▂▁▁▁ |
| noxes | 131073 | 0.38 | 76.59 | 74.87 | -1.4 | 32.8 | 56.9 | 94.1 | 1431.8 | ▇▁▁▁▁ |
| pm10 | 153450 | 0.27 | 18.71 | 13.18 | -3.5 | 10.9 | 15.8 | 23.1 | 761.6 | ▇▁▁▁▁ |
| oz | 181985 | 0.13 | 40.50 | 23.12 | -0.2 | 23.9 | 41.2 | 56.0 | 174.1 | ▆▇▁▁▁ |
| pm2_5 | 183227 | 0.13 | 12.15 | 9.58 | -4.0 | 6.6 | 9.5 | 14.4 | 289.2 | ▇▁▁▁▁ |
| so2 | 182433 | 0.13 | 3.01 | 3.36 | -1.1 | 0.9 | 1.7 | 3.7 | 50.5 | ▇▁▁▁▁ |
Variable type: POSIXct
| skim_variable | n_missing | complete_rate | min | max | median | n_unique |
|---|---|---|---|---|---|---|
| obsDateTime | 0 | 1 | 2016-01-01 | 2019-12-31 | 2017-12-30 12:30:00 | 34972 |
t <- dt[, .(`co: Carbon Monoxide, mg/m3` = mean(co, na.rm = TRUE), `nox = Nitric Oxide, ug/m3` = mean(nox, na.rm = TRUE),
`nox2 = Nitrogen Dioxide, ug/m3` = mean(nox2, na.rm = TRUE), `noxes = Oxides of Nitrogen, ug/m3` = mean(noxes, na.rm = TRUE),
`oz = ozone, ug/m3` = mean(oz, na.rm = TRUE), `pm10, ug/m3` = mean(pm10, na.rm = TRUE), `pm2_5, ug/m3` = mean(pm2_5,
na.rm = TRUE), `so2 = Sulphur Dioxide, ug/m3` = mean(so2, na.rm = TRUE)), keyby = .(site)]
kableExtra::kable(t, caption = "Mean values per site (NaN indicates not measured)") %>% kable_styling()
| site | co: Carbon Monoxide, mg/m3 | nox = Nitric Oxide, ug/m3 | nox2 = Nitrogen Dioxide, ug/m3 | noxes = Oxides of Nitrogen, ug/m3 | oz = ozone, ug/m3 | pm10, ug/m3 | pm2_5, ug/m3 | so2 = Sulphur Dioxide, ug/m3 |
|---|---|---|---|---|---|---|---|---|
| Southampton - A33 Roadside AURN | NaN | 34.00597 | 35.79520 | NaN | NaN | 19.04556 | NaN | NaN |
| Southampton - Bitterne | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN |
| Southampton - Onslow Road | NaN | 29.84889 | 42.20433 | 87.97470 | NaN | NaN | NaN | NaN |
| Southampton - Redbridge | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN |
| Southampton - Victoria Road | NaN | 27.43040 | 39.90371 | 81.96375 | NaN | NaN | NaN | NaN |
| Southampton Background AURN | NaN | 13.24819 | 29.55140 | 50.78906 | 40.50492 | 18.27441 | 12.15377 | 3.014884 |
Table 3.1 gives an indication of the availability of the different measures.
In this section we present graphical analysis of the previoulsy downloaded data. Note this is just a snapshot of the data available.
yLab <- "Nitrogen Dioxide (ug/m3)"
t <- lDT[variable == "nox2", .(mean = mean(value, na.rm = TRUE), sd = sd(value, na.rm = TRUE), min = min(value, na.rm = TRUE),
max = max(value, na.rm = TRUE)), keyby = .(site)]
kableExtra::kable(t, caption = "Summary of nox2 data") %>% kable_styling()
| site | mean | sd | min | max |
|---|---|---|---|---|
| Southampton - A33 Roadside AURN | 35.79520 | 25.00895 | 0.0 | 164.3 |
| Southampton - Onslow Road | 42.20433 | 21.09972 | 1.2 | 241.3 |
| Southampton - Victoria Road | 39.90371 | 23.96440 | -1.3 | 287.5 |
| Southampton Background AURN | 29.55140 | 16.94370 | 2.3 | 144.2 |
Table 4.1 suggests that there may be a few (5) negative values. These are summarised in 4.2 while Figure 4.1 shows the availability and levels of the pollutant data over time.
t <- head(dt[nox2 < 0], 10)
kableExtra::kable(t, caption = "Negative nox2 values (up to first 6)") %>% kable_styling()
| nox | nox2 | noxes | pm10 | site | co | oz | pm2_5 | so2 | obsDateTime |
|---|---|---|---|---|---|---|---|---|---|
| 0.4 | -0.1 | 0.6 | NA | Southampton - Victoria Road | NA | NA | NA | NA | 2016-01-29 04:00:00 |
| 0.8 | -0.5 | 0.7 | NA | Southampton - Victoria Road | NA | NA | NA | NA | 2016-11-27 05:00:00 |
| 0.9 | -1.1 | 0.3 | NA | Southampton - Victoria Road | NA | NA | NA | NA | 2016-11-27 06:00:00 |
| 1.5 | -0.2 | 2.1 | NA | Southampton - Victoria Road | NA | NA | NA | NA | 2017-02-06 00:00:00 |
| 1.1 | -1.3 | 0.3 | NA | Southampton - Victoria Road | NA | NA | NA | NA | 2017-02-06 01:00:00 |
t <- table(dt[nox < 0]$site)
kableExtra::kable(t, caption = "Negative nox2 values (count by site)") %>% kable_styling()
| Var1 | Freq |
|---|---|
| Southampton - Onslow Road | 248 |
| Southampton - Victoria Road | 168 |
# dt,xvar, yvar,fillVar, yLab
p <- makeTilePlot(lDT[variable == "nox2"], xVar = "obsDateTime", yVar = "site", fillVar = "value", yLab = yLab)
p
Figure 4.1: Nitrogen Dioxide data availability and levels over time
# p <- ggplot2::ggplot(dt, aes(x = obsDateTime, y = nox2, colour = site, alpha = 0.1)) + geom_point(shape=4, size = 1)
t <- lDT[variable == "nox2" & value > 200][order(-value)]
kableExtra::kable(caption = paste0("Values greater than WHO threshold (NO2 > ", hourlyno2Threshold_WHO, ")"), head(t, 10)) %>%
kable_styling()
| site | obsDateTime | variable | value |
|---|---|---|---|
| Southampton - Victoria Road | 2016-11-30 17:00:00 | nox2 | 287.5 |
| Southampton - Victoria Road | 2016-11-30 19:00:00 | nox2 | 275.3 |
| Southampton - Victoria Road | 2016-11-30 18:00:00 | nox2 | 268.7 |
| Southampton - Victoria Road | 2017-01-05 18:00:00 | nox2 | 251.6 |
| Southampton - Victoria Road | 2017-01-05 17:00:00 | nox2 | 247.3 |
| Southampton - Victoria Road | 2017-01-24 18:00:00 | nox2 | 243.5 |
| Southampton - Victoria Road | 2017-01-24 19:00:00 | nox2 | 242.0 |
| Southampton - Onslow Road | 2016-03-08 09:00:00 | nox2 | 241.3 |
| Southampton - Victoria Road | 2017-01-03 08:00:00 | nox2 | 234.4 |
| Southampton - Victoria Road | 2017-01-03 09:00:00 | nox2 | 232.8 |
p <- makeDotPlot(lDT[variable == "nox2"], xVar = "obsDateTime", yVar = "value", byVar = "site", yLab = yLab)
p <- p + geom_hline(yintercept = hourlyno2Threshold_WHO) + labs(caption = "Reference line = WHO hourly guideline threshold")
if (doPlotly) {
p
plotly::ggplotly(p + xlim(xlimMinDateTime, xlimMaxDateTime)) # interactive, xlimited
} else {
p
}